package com.juneyaoair.search.controller;

import com.juneyaoair.search.entity.MessageEntity;
import com.juneyaoair.search.response.ResponseResult;
import com.juneyaoair.search.service.ElasticService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 信息检索
 * @author :master
 * @date :20200909
 */
@RequestMapping("/elasticMessage")
@RestController
@Api(value = "ElasticIndexController", description = "索引接口相关api")
public class ElasticIndexController {

    @Autowired
    private ElasticService elasticService;

    /**
     * 信息检索
     * @param messageEntity 参数
     * @return 返回
     */
    @ApiOperation(value = "信息检索", notes="信息检索")
    @PostMapping(value = "/queryGmtMessage")
    public ResponseResult queryGmtMessage (@RequestBody MessageEntity messageEntity) {
        return elasticService.messageQuery(messageEntity);
    }
}